//
//  SingleThirdDetailsViewController.m
//  项目A --半糖
//
//  Created by romana on 16/5/27.
//  Copyright © 2016年 romana. All rights reserved.
//

#import "SingleThirdDetailsViewController.h"
#import "UIImageView+WebCache.h"
#import "SingleFourthDetailsViewController.h"
//#import "UMSocialSnsPlatformManager.h"

#define WIDTH self.view.frame.size.width
#define HEIGHT self.view.frame.size.height

@interface SingleThirdDetailsViewController ()

@end

@implementation SingleThirdDetailsViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    //右按钮分享
    //self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemReply target:self action:@selector(rightBarAction)];
    
    self.view.backgroundColor = [UIColor whiteColor];
  //  NSLog(@"%@",self.SDBigModel.title);
    
    UIImageView *bigImageV = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, WIDTH, 300)];
    [bigImageV sd_setImageWithURL:[NSURL URLWithString:self.SDBigModel.pic]];
    [self.view addSubview:bigImageV];
    
    UILabel *titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, 300, WIDTH, 50)];
    titleLabel.text = self.SDBigModel.title;
    titleLabel.textAlignment = NSTextAlignmentCenter;
    [self.view addSubview:titleLabel];
    
    UILabel *priceLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 350, WIDTH / 2, 50)];
  //  priceLabel.text = self.SDBigModel.price;
    NSString *string = [NSString stringWithFormat:@"¥%@",self.SDBigModel.price];
    priceLabel.text = string;
    priceLabel.textColor = [UIColor redColor];
    priceLabel.textAlignment = NSTextAlignmentCenter;
    [self.view addSubview:priceLabel];
    
    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
    button.backgroundColor = [UIColor redColor];
    button.frame = CGRectMake(WIDTH / 2, 350, WIDTH / 2, 50);
    button.layer.masksToBounds = YES;
    button.layer.cornerRadius = 20;
    [button setTitle:@"购买" forState:UIControlStateNormal];
    [button addTarget:self action:@selector(buttonAction) forControlEvents:UIControlEventTouchUpInside
     ];
    [self.view addSubview:button];
    
    UILabel *descLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 400, WIDTH, 200)];
    descLabel.text = self.SDBigModel.desc;
    descLabel.numberOfLines = 0;
    [self.view addSubview:descLabel];
    
    UIView *gapView = [[UIView alloc] initWithFrame:CGRectMake(0, 600, WIDTH, 5)];
    gapView.backgroundColor = [UIColor grayColor];
    [self.view addSubview:gapView];
    
    
    
    
    
    
    // Do any additional setup after loading the view.
}



-(void)buttonAction{


   // NSLog(@"1123456");

    SingleFourthDetailsViewController *SinFouDVC = [[SingleFourthDetailsViewController alloc] init];
    SinFouDVC.webURL = self.SDBigModel.url;
    [self.navigationController pushViewController:SinFouDVC animated:YES];



}


@end
